<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    
  </style>
</head>
<body>
  
</body>
<script>
  class Parent{
    constructor(n){
      this.name = n
    }
    show(){
      console.log(this.name)
    }
  }
  // ES6的class继承
  class Child extends Parent{
    constructor(n){
      super(n);
    }
    show(){
      console.log("hahhaha")
    }
  }

  const p = new Parent("hello")
  console.log(p)
  p.show();

  const c = new Child("world");
  console.log(c);
  c.show();

  // 父类是子类的超类
</script>
</html>